import {createApp} from 'vue'
import App from './App.vue'

const app = createApp(App)

// 引入全局样式
// 字体
import '~/assets/font/font.css'
// codemirror
// import 'codemirror/lib/codemirror.css'


// 注册 quasar 框架
import {Quasar, Cookies, Dialog, Notify, Meta} from 'quasar'
import quasarLang from 'quasar/lang/zh-CN'
import '@quasar/extras/material-icons/material-icons.css'
import '@quasar/extras/material-icons-round/material-icons-round.css'
import '@quasar/extras/fontawesome-v6/fontawesome-v6.css'
import 'quasar/src/css/index.sass'
// 过渡动画
import '@quasar/extras/animate/fadeIn.css'
import '@quasar/extras/animate/fadeOut.css'
import '@quasar/extras/animate/slideOutLeft.css'
import '@quasar/extras/animate/slideInRight.css'
import '@quasar/extras/animate/lightSpeedOutLeft.css'
import '@quasar/extras/animate/lightSpeedInRight.css'
import '@quasar/extras/animate/fadeOutLeft.css'
import '@quasar/extras/animate/fadeInLeft.css'

app.use(Quasar, {
    plugins: {
        Cookies,
        Dialog,
        Notify,
        Meta
    },
    lang: quasarLang,
})

// 注册 quasar 总线
import {EventBus} from 'quasar'

const bus = new EventBus()
app.provide('bus', bus)


// 注册pinia
import {createPinia} from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist'

const store = createPinia()
store.use(piniaPluginPersist) // 持久化
app.use(store)


// 注册路由
import router from "~/utils/router/index.js";

app.use(router)


// 挂载
app.mount('#app')
